package com.cyq.day12;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
//        Book book = new Book();
//        book.author="我吃西红柿";
//        book.bookName="盘龙";
//        book.num=1;
//        book.price=30;
//        Student student = new Student();
//        student.setAge(18);
//        student.setName("张三");
//        student.setNum(0);
//        student.setSex(false);
//        System.out.println(student.name);
        Book[] books = new Book[5];
        Scanner scanner = new Scanner(System.in);
        for (int i=0;i<books.length;i++){
            books[i]=new Book();
            System.out.println("请输入第"+(i+1)+"本书的名字");
            books[i].bookName=scanner.next();
            System.out.println("请输入第"+(i+1)+"本书的作者");
            String author= scanner.next();
            books[i].author=author;
            System.out.println("请输入第"+(i+1)+"本书的价格");
            int price= scanner.nextInt();
            books[i].price=price;
            System.out.println("请输入第"+(i+1)+"本书的编号");
            int num= scanner.nextInt();
            books[i].num=num;
            System.out.println("请问要继续输入吗，继续回复yes，不继续回复no");
            String input= scanner.next();
            if ("no".equals(input)){
                break;
            }
        }
        System.out.println("==============书籍清单=================");
        for (int i=0;i<books.length;i++){
            if (books[i]!=null){
                System.out.println(books[i].num+" "+books[i].price+" "+books[i].author+" "+books[i].bookName);
            }
        }
    }
}
